
#include "CBaseScene.h"
#include "os.h"
namespace game
{
	namespace scene
	{	
		CBaseScene::CBaseScene(scene::SGameSceneEntry* entry, irr::scene::ISceneManager* sceneManager, video::IVideoHandler* videoHandler)
			:	scene::IGameScene(entry, sceneManager, videoHandler),
			Established(false)
			//GameSceneManager(0)
		{

			//this->GameSceneManager = gameSceneManager;
		}

		CBaseScene::~CBaseScene()
		{

		}

		void CBaseScene::establishScene()
		{
			//establishObjects();

			//establishControls();

			//this->Established = true;
		}

		//void CBaseScene::establishObjects()
		//{
		//	/*irr::core::list<scene::IDynamicObject*>::Iterator it = DynamicObjects.getLast();
		//	
		//	for(u32 i = DynamicObjects.getSize();i>0;i--)
		//	{
		//		(*it)->addToScene();
		//		
		//		it--;
		//	}*/

		//}


		/*void CBaseScene::onNetworkManagerDisconneted()
		{

		}*/

		/*bool CBaseScene::onNetworkRequest()
		{
		return false;
		}*/

		//bool CBaseScene::onUserAction(SUserAction action)
		//{
		//	bool result = false;

		//	switch(action.KeyCode)
		//	{
		//	case irr::KEY_MOUSE:
		//		{
		//			if(action.KeyState == KEY_STATE_MOUSE_MOVE)
		//			{
		//				//printf("\nangle %d \n", action.MouseMovingInfo.getAngle());

		//				//printf("\nlength %f \n", action.MouseMovingInfo.getLength());

		//				//printf("\nX %d \n", action.MouseMovingInfo.X);
		//				//printf("\nY %d \n", action.MouseMovingInfo.Y);

		//				result = true;
		//			}
		//			else if (action.KeyState == KEY_STATE_MOUSE_STOPPED)
		//			{
		//				result = true;
		//				//printf("\nCBASESTOP");
		//			}
		//			else
		//			{
		//				//printf("\nCBASE MOUSE UNHANDLED!!!!!!!!!!!");
		//			}


		//			break;
		//		}
		//	case irr::KEY_START:
		//		{
		//			this->GameSceneManager->getDynamicObject("sceneObject.xml",  scene::EGO_CHARACTER);
		//			
		//			break;
		//		}
		//	

		//	default:
		//		break;
		//	}

		//	return result;
		//}

		/*scene::IGameSceneManager* CBaseScene::getGameSceneManager()
		{
		return this->GameSceneManager;
		}*/

		/*void CBaseScene::addGameObject(scene::IDynamicObject* sceneObj)
		{
		this->DynamicObjects.push_back(sceneObj);

		if(this->Established)
		{
		sceneObj->addToScene();
		}
		}*/

		//	void CBaseScene::establishState()
		//	{
		//		//game::DeviceManage* a = game::DeviceManager::Instance;
		//		game::DeviceManager::getInstance().clearScreen();
		//		game::DeviceManager::getInstance().lock();
		//
		//		this->establishControls();
		//		this->establishScene();
		//
		//		game::DeviceManager::getInstance().unlock();
		//		
		//		Established = true;
		//	}
		//
		/*void CBaseScene::establishControls()
		{
		}*/

		//
		//	void CBaseScene::onNetworkManagerDisconneted()
		//	{
		//		
		//	}
		//
		//	bool CBaseScene::onServerRequest()
		//	{
		//		return false;
		//	}
	}
}
